Make possible to generate a build profile from the command line#103097
Make possible to generate a build profile from the command line#103097YeldhamDev wants to merge 1 commit intogodotengine:masterfrom
Conversation
ad6ac56 to
00bf1cc
Compare
There was a problem hiding this comment.
Tested locally, it mostly works as expected. Code looks good to me.
Remember to update misc/dist/shell/godot.bash-completion too.
As for generation itself, I get many errors when running on the 3D platformer demo if I didn't open the project in the editor beforehand to create .godot/:
[ 0% ] first_scan_filesystem | Started Project initialization (5 steps)
[ 0% ] first_scan_filesystem | Scanning file structure...
[ 16% ] first_scan_filesystem | Loading global class names...
[ 33% ] first_scan_filesystem | Verifying GDExtensions...
[ 50% ] first_scan_filesystem | Creating autoload scripts...
[ 66% ] first_scan_filesystem | Initializing plugins...
[ 83% ] first_scan_filesystem | Starting file scan...
[ DONE ] first_scan_filesystem
ERROR: res://game.tscn:22 - Parse Error: Missing 'type' in external resource tag.
at: _printerr (./scene/resources/resource_format_text.cpp:39)
ERROR: Condition "p_f->get_error() != OK" is true.
at: get_classes_used (./core/io/resource_format_binary.cpp:943)
ERROR: res://enemy/enemy.tscn:444 - Parse Error: Missing 'type' in external resource tag.
at: _printerr (./scene/resources/resource_format_text.cpp:39)
ERROR: Condition "p_f->get_error() != OK" is true.
at: get_classes_used (./core/io/resource_format_binary.cpp:943)
ERROR: res://player/player.tscn:116 - Parse Error: Missing 'type' in external resource tag.
at: _printerr (./scene/resources/resource_format_text.cpp:39)
ERROR: res://stage/stage.tscn:26 - Parse Error: Missing 'type' in external resource tag.
at: _printerr (./scene/resources/resource_format_text.cpp:39)
ERROR: 1 RID allocations of type 'P11JoltShape3D' were leaked at exit.
ERROR: 6 RID allocations of type 'P10JoltBody3D' were leaked at exit.
ERROR: Pages in use exist at exit in PagedAllocator: N33RendererSceneRenderImplementation22RenderForwardClustered32GeometryInstanceForwardClusteredE
at: ~PagedAllocator (./core/templates/paged_allocator.h:169)
ERROR: 2 shaders of type SceneForwardClusteredShaderRD were never freed
at: ~ShaderRD (./servers/rendering/renderer_rd/shader_rd.cpp:1042)
ERROR: 6 RID allocations of type 'N10RendererRD12LightStorage13LightInstanceE' were leaked at exit.
ERROR: 6 RID allocations of type 'N10RendererRD12LightStorage5LightE' were leaked at exit.
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
ERROR: 6 RID allocations of type 'N10RendererRD11MeshStorage9MultiMeshE' were leaked at exit.
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
ERROR: 2 RID allocations of type 'N10RendererRD11MeshStorage4MeshE' were leaked at exit.
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
ERROR: 2 RID allocations of type 'N10RendererRD15MaterialStorage8MaterialE' were leaked at exit.
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
WARNING: Leaked instance dependency: Bug - did not call instance_notify_deleted when freeing.
at: ~Dependency (./servers/rendering/storage/utilities.cpp:56)
ERROR: 2 RID allocations of type 'N10RendererRD15MaterialStorage6ShaderE' were leaked at exit.
ERROR: 18 RID allocations of type 'N17RendererSceneCull8InstanceE' were leaked at exit.
WARNING: 6 RIDs of type "StorageBuffer" were leaked.
at: _free_rids (./servers/rendering/rendering_device.cpp:6957)
WARNING: 2 RIDs of type "UniformBuffer" were leaked.
at: _free_rids (./servers/rendering/rendering_device.cpp:6957)
WARNING: 2 RIDs of type "IndexArray" were leaked.
at: _free_rids (./servers/rendering/rendering_device.cpp:6957)
WARNING: 2 RIDs of type "IndexBuffer" were leaked.
at: _free_rids (./servers/rendering/rendering_device.cpp:6957)
WARNING: 4 RIDs of type "VertexBuffer" were leaked.
at: _free_rids (./servers/rendering/rendering_device.cpp:6957)
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
at: cleanup (./core/object/object.cpp:2490)
ERROR: 11 resources still in use at exit (run with --verbose for details).
at: clear (./core/io/resource.cpp:784)
The generated profile will also be different, while the CLI/GUI profiles are 100% identical if resources were imported before running --generate-build-profile. This can't happen in a GUI scenario as you always have resources imported while the editor is open.
|
@Calinou This can be solved by running |
I would make |
00bf1cc to
e175283
Compare
|
@Calinou Try again, please. |
|
I still get errors with the latest revision of this PR on the 3D platformer demo when generating a profile after removing DetailsThis time, all 3 profiles are slightly different from each other:
Differences only seem to be on animation classes like |
e175283 to
4b0d105
Compare
|
Alright, found the problems:
There's still a crash that happens on exit, but that appears to be from a regression unrelated to this PR. @Calinou Once more, please try again. |
|
It works better now (no more error messages if |
|
Are you sure? On my end the files end up identical, what is the command you're passing? |
032fac7 to
365d99a
Compare
|
|
I'm sorry, but they are completely identical on my end. I've no clue what's going on... |
I tested this with a dev build, and I get a Scan / import / detect logsErrors and crash: |
|
@godotengine/rendering My PR appears to expose a preexisting bug on rendering cleanup (see above). Could you guys lend a hand? |
I doubt its a pre-existing bug. The crash is on an assert that happens at de-initialization time to say that not all memory allocations were freed. I suspect that the change in logic with this PR results in not all rendering resources getting freed before closing |
|
@clayjohn The problem is that I have no clue what could be causing it. It only happens if the assets haven't being imported at least once. |
365d99a to
edc5c42
Compare
|
I've managed to fix the crash (on headless mode, at least), it was caused by a missing check. However, those errors still remain (they only appear when running it without the assets being imported first): When running with And seem to come from the same file in the 3D platformer demo: |
This PR adds
--generate-build-profileoption to the editor binary, allowing to generate a build profile from the command line. By doing:It detects what is being used in the project, and places the generated profile in the specified file path. This will be very handy for CI builds.
Sponsored By: 🐺 Lone Wolf Technology / 🍀 W4 Games.